package zero.tech.wsnet.common;

import zero.tech.core.data.Resp;
import zero.tech.core.util.EngineLogUtil;
import zero.tech.core.work.AynWork;
import zero.tech.wsnet.data.Message;
import zero.tech.wsnet.net.WebClient;

public abstract class ReqProcess extends AynWork {
//	private static final Logger logger = LoggerFactory.getLogger(ReqProcess.class);
	private Message message;
	private WebClient client;

	@Override
	public void init(Object... objs) throws Exception {
		this.message = (Message) objs[0];
		this.client = (WebClient) objs[1];
	}

	public abstract void process(WebClient webClient, Resp param);

	@Override
	public void run() {
//		logger.info("请求数据------------->{}", message);
		try {
			process(client, this.message.getData());
		} catch (Exception e) {
			EngineLogUtil.traceFull(e);
		}
	}
}
